/*
 * @Author: Zeratul
 * @Date: 2020-08-19 20:04:34
 * @LastEditTime: 2020-08-23 23:41:00
 * @FilePath: \sz-h5-2003-react-mobile\zhangminhui\eleme-react\eleme-apiServer\config.js
 */
/**
 * 配置连接项并暴露接口
 */
const connection = {
  host: "175.24.122.212",
  user: "root",
  password: "root",
  database: "chileme",
};
const spell =
  "Expecto Patronum,Avada Kedavra,Imperio,Crucio,Petrificus Totalus,Obliviate,Reducto,Stupefy";
/**
 * 设置ID
 * @param {String} table 表名
 */
function SetID(tablename) {
  var num = 1000;
  var random = Math.floor(Math.random() * (1000 - 100)) + 100;
  switch (tablename) {
    case "users":
      num = num + 1;
      break;
    case "addresses":
      num = num + 2;
      break;
    case "follows":
      num = num + 3;
      break;
    case "level":
      num = num + 4;
      break;
    case "meals":
      num = num + 5;
      break;
    case "orders":
      num = num + 6;
      break;
    case "order_evaluations":
      num = num + 7;
      break;
    case "packing_evalueations":
      num = num + 8;
      break;
    case "products":
      num = num + 9;
      break;
    case "rider_evaluation":
      num = num + 10;
      break;
    case "shop_evaluation":
      num = num + 11;
      break;
    case "shop_type_one":
      num = num + 12;
      break;
    case "shop_type_two":
      num = num + 13;
      break;
    case "shopcars":
      num = num + 14;
      break;
    case "shopkeeper":
      num = num + 15;
      break;
    case "sort_one":
      num = num + 16;
      break;
    case "sort_two":
      num = num + 17;
      break;
    case "tag_items":
      num = num + 18;
      break;
    case "taste_evaluation":
      num = num + 19;
      break;
    case "vip_members":
      num = num + 20;
      break;
    default:
      console.log("！！！！no such table！！！！");
      break;
  }
  var str = num.toString() + random + Date.now();
  return Number(str);
}
module.exports = {
  connection,
  spell,
  SetID,
};
